
<? if(!$isphone) { 
	foreach($edit_grps as $item) {
		$gkey = $item[0];
		$ga = explode("|", $gkey);
		$gkey = '';
		foreach($ga as $gs) {
			if($gkey != '') $gkey .= "|";
			$gkey .= "edit_grp_".$gs;
		}
		$editable1 = $item[1];
	?>
<div name="<?=$gkey?>">
<?
foreach($editable1 as $zd => $item) { 
	if($item['type'] == 'hidden') {
		writeEdit($zd, $data, $item['style'], $edit_id);
	}
}
?>
<table cellpadding="0" cellspacing="1" border="0" class="tb" width="100%">
<col width="120" />
<col width="260" />
<col width="120" />
<col width="260" />
<tr>
<? 
$n = 0;
$nn = 0;
foreach($editable1 as $zd => $item) { 
	if($item['type'] == 'hidden') continue;
	$nn++;
	if($item['col'] == 2 || strpos($zd, 'subtitle_') === 0) {
		if($n % 2 != 0) echo '<th height="30" style="position: static;border-bottom:1px solid #DDDDDD;">&nbsp;</th><td>&nbsp;</td>';
		if($n != 0) echo '</tr><tr>';
		$n = 1;
	} else {
		if($n != 0 && $n%2== 0) echo '</tr><tr>';
	}
	if(strpos($zd, 'subtitle_') === 0) {
		echo '<td colspan="4"><div style="color:blue;font-weight:bold;font-size:16px;margin-bottom:5px'.($nn>1?';margin-top:15px':'').'">'.$item['title'].'</div></td>';
		$n = 2;
		continue;
	}
	?>
	<th height="30" style="position: static;border-bottom:1px solid #DDDDDD;"><span id="edit_title_<?=$zd?>"><? echo $item['title']; ?></span><span style="color:red;<?if($item['must'] != 1) echo 'display:none;';?>" id="edit_title_star_<?=$zd?>"> *</span></th>
	<td<? if($item['col'] == 2) {?> colspan="3"<? } ?>><?
	$iswriteedit = true;
	if($item['func']) {
		$func = $item['func'];
		$param = $item['funcParam'];
		$r = $func($data, $edit_id, $param, $item);
		if($r !== true) $iswriteedit = false;

	}
		
	if($iswriteedit) writeEdit($zd, $data, $item['style'], $edit_id); 

	?><? if($item['tip']) echo ' <span id="edit_tip_'.$zd.'">'.$item['tip'].'</span>';?></td>
<? 
$n++;
} 
if($n % 2 != 0) echo '<th style="position: static;border-bottom:1px solid #DDDDDD;">&nbsp;</th><td>&nbsp;</td>';
?>
</tr>
</table>
</div>
<? } } else { 


foreach($edit_grps as $item) {
		$gkey = $item[0];
		$ga = explode("|", $gkey);
		$gkey = '';
		foreach($ga as $gs) {
			if($gkey != '') $gkey .= "|";
			$gkey .= "edit_grp_".$gs;
		}
		$editable1 = $item[1];
	?>

<div name="<?=$gkey?>">

<?
foreach($editable1 as $zd => $item) { 
	if($item['type'] == 'hidden') {
		writeEdit($zd, $data, $item['style'], $edit_id);
	}
}
?>

<table cellpadding="0" cellspacing="1" border="0" class="tb" width="100%">
<tr>
<? 
$n = 0;
$nn = 0;
foreach($editable1 as $zd => $item) { 
	if($item['type'] == 'hidden') continue;
	$nn++;
	if($item['col'] == 2 || strpos($zd, 'subtitle_') === 0) {
		if($n % 2 != 0) echo '<td height="30" width="50%">&nbsp;</td>';
		if($n != 0) echo '</tr><tr>';
		$n = 1;
	} else {
		if($n != 0 && $n%2== 0) echo '</tr><tr>';
	}
	if(strpos($zd, 'subtitle_') === 0) {
		echo '<td colspan="2"><div style="color:blue;font-weight:bold;font-size:16px;margin-bottom:5px'.($nn>1?';margin-top:15px':'').'">'.$item['title'].'</div></td>';
		$n = 2;
		continue;
	}
	?>
	<td<? if($item['col'] == 2) {?> colspan="2"<? } ?> style="padding-bottom:5px"><? if($item['title']) { ?><div style="margin-top:5px;font-weight:bold"><span id="edit_title_<?=$zd?>"><? echo $item['title']; ?></span><span style="color:red;<?if($item['must'] != 1) echo 'display:none;';?>" id="edit_title_star_<?=$zd?>"> *</span>:</div><? } else { ?> <span id="edit_title_<?=$zd?>"></span><span style="color:red;<?if($item['must'] != 1) echo 'display:none;';?>" id="edit_title_star_<?=$zd?>"> *</span> <? }
	$iswriteedit = true;
	if($item['func']) {
		$func = $item['func'];
		$param = $item['funcParam'];
		$r = $func($data, $edit_id, $param, $item);
		if($r !== true) $iswriteedit = false;

	} 
	if($iswriteedit) writeEdit($zd, $data, $item['style'], $edit_id); 

	?><? if($item['tip']) echo ' <span id="edit_tip_'.$zd.'">'.$item['tip'].'</span>';?></td>
<? 
$n++;
} 
if($n % 2 != 0) echo '<td>&nbsp;</td>';
?>
</tr>
</table>
</div>
<? }

	 
}
 ?>


<?
$canedit = false;
foreach($editable as $zd => $item) { 
	if(!$item['notedit'] && !$item['readonly']) $canedit = true;
	if($item['type'] != 'hidden') continue;
	writeEdit($zd, $data, '', $edit_id); 
}

?>
<? if($canedit) { 
	$savebt_title = $config['savebt_title'];
	if(!$savebt_title) $savebt_title = '保存';
	?>
<div style="text-align:center;margin-top:10px">

<?
if($config['more_edit_bts']) {
foreach($config['more_edit_bts'] as $key => $item) {
	$bgcolor = $item['bgcolor'];
	$notcheck = $item['notcheck'];

	$notcheck_b = 'false';
	if($notcheck) $notcheck_b = 'true';
	if($bgcolor) $bgcolor = "background:".$bgcolor.";";
?>
<input id="savebt_<?=$key?>" class="button" type="button" value="<?=$item['title']?>" style="cursor:pointer;<?=$bgcolor?>" onclick="setDeal('<?=$showtype?>', '<?=$edit_id?>', '<?=$item['edit_m']?>', '<?=$key?>', <?=$notcheck_b?>)" />
<?
}
}

$edit_m = $config['edit_m'];
if(!$edit_m) $edit_m = 'save';
?>

<input id="savebt" class="button" type="button" value="<?=$savebt_title?>" style="cursor:pointer" onclick="setDeal('<?=$showtype?>', '<?=$edit_id?>', '<?=$edit_m?>', null, null)" />


</div>
<? } ?>

<? if($config['editExtraHtml']) { ?>
<div style="margin-top:10px">
<?=$config['editExtraHtml']?>
</div>
<? } ?>

<div style="margin-top:10px">
&nbsp;
</div>